<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="q" uri="/query-tags"%>
<html>
	<head>
		<title>查询</title>
		
		<link href="${pageContext.request.contextPath}/core/css/style.css" rel="stylesheet" type="text/css" />
		
		
		<script language="javascript" type="text/javascript" 
			src="${pageContext.request.contextPath}/core/js/jquery.js"></script>

		<script language="javascript" type="text/javascript" 
			src="${pageContext.request.contextPath}/core/js/jquery.form.js"></script>
		
		<script type="text/javascript">
		
		
		$(function(){
	
			//如果是必填的，则加红星标识.
			$("form :input[type=text]").each(function(){
				var $required = $("<strong class='high'> *</strong>"); //创建元素
				$(this).parent().append($required); //然后将它追加到文档中
			});

			//文本框失去焦点后
		    $('form :input').blur(function(){
				 var $parent = $(this).parent();
				 $parent.find(".formtips").remove();
				 
				 //遍历form
				 var elements=document.forms[0].elements;
				 //alert(elements);
				 for(i=0; i<elements.length; i++){
					 if(elements[i].type != "button"){
						 alert("name=  " + elements[i].name);
						 alert("value=   " + elements[i].value);
					 }
				 }	 
			}).keyup(function(){$(this).triggerHandler("blur");}).focus(function(){$(this).triggerHandler("blur");});//end blur

			
			
			
			var options= {
					target:"#main"
			};	
			$("#findId").click(function(){
//				if($("itemNameCn".value == ""))
//				{
//				alert("XX不能为空");
//				}
		//		isEmpty("itemNameCn","ooooooooee");
				
				$("#findForm").ajaxSubmit(options);
			});
			$("#resetId").click(function(){
				$("#findForm").resetForm(options);
			});
		});
	
		</script>
	</head>
	<body>
		<div style="width: 800px" align="center">
			<fieldset style="width: 700px;">
				<legend>
					<label>国家·信息查询</label>
				</legend>
				<div>
					<form action="findByPage" id="findForm">
						<div>
							<label>通用中文名</label>
							<input type="text" name="qu.itemNameCn" id="itemNameCn"/>
						</div>
				
						<div>
							<label>通用英文名</label>
							<input type="text" name="qu.itemNameEn" id="itemNameEn"/>
						</div>
				
						<div>
							<input type="button" id="findId" value="查询"/>
							<input type="button" id="resetId" value="重置"/>
						</div>
					</form>
					
				</div>
			</fieldset>
		</div>
		
		<div id="main">
		   <s:action name="findByPage"  executeResult="true">
		   </s:action> 
		</div>
		
	</body>
</html>


